const configWeb3 = require('../../config/web3');

const ethers = require('ethers');
let provider = new ethers.providers.JsonRpcProvider(configWeb3.provider);
let abi = configWeb3.abi.EtherToken;

module.exports = {
    async balanceOf(address) {
        let contract = new ethers.Contract(configWeb3.address.EtherToken, abi, provider);
        let res = await contract.balanceOf(address);
        return res.toString();
    },
    async address() {
        return configWeb3.address.EtherToken;
    }
};